import React, {
    Component
} from 'react'
import {
    render
} from 'react-dom'
import {
    Router,
    Route,
    IndexRoute,
    hashHistory
} from 'react-router'

//引用样式
import './Scss/reset.scss'
import './Scss/viewer.min.scss'
import './Scss/LArea.min.css'
import './scss/media.px'
import './scss/public.scss'
import './scss/pjb.scss'
import './scss/lt.scss'
import './scss/integral.scss'
import './scss/info.scss'

//引入vconsole调试
// import './js/vconsole.js'

//引入组件

//公共盒子
const Roots = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/Common/Roots').default)
    }, 'Roots')
}

//家校通
const Index = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/Index').default)
    }, 'Index')
}
const Notice = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/Notice').default)
    }, 'Notice')
}
const NtcDetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/NtcDetail').default)
    }, 'NtcDetail')
}
const NtcDetailFile = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/NtcDetailFile').default)
    }, 'NtcDetailFile')
}
const Task = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/Task').default)
    }, 'Task')
}
const TaskDetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/TaskDetail').default)
    }, 'TaskDetail')
}
const TaskPublish = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/TaskPublish').default)
    }, 'TaskPublish')
}
const Score = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/Score').default)
    }, 'Score')
}
const ScoreDetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/ScoreDetail').default)
    }, 'ScoreDetail')
}
const ClassAlbum = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/ClassAlbum').default)
    }, 'ClassAlbum')
}
const AddPhoto = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/AddPhoto').default)
    }, 'AddPhoto')
}
const AddAlbum = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/AddAlbum').default)
    }, 'AddAlbum')
}
const AlbumDetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/AlbumDetail').default)
    }, 'AlbumDetail')
}
const ApplyLeave = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/ApplyLeave').default)
    }, 'ApplyLeave')
}
const LeaveDetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/LeaveDetail').default)
    }, 'LeaveDetail')
}
const LeaveList = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/LeaveList').default)
    }, 'LeaveList')
}
const SubjectTimetable = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/SubjectTimetable').default)
    }, 'SubjectTimetable')
}
const PhoneDirectories = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/PhoneDirectories').default)
    }, 'PhoneDirectories')
}
const GrowthRecord = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/GrowthRecord').default)
    }, 'GrowthRecord')
}
const GrowthRecordDetails = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/GrowthRecordDetails').default)
    }, 'GrowthRecordDetails')
}
const AddGrowthRecord = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/AddGrowthRecord').default)
    }, 'AddGrowthRecord')
}
const News = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/News').default)
    }, 'News')
}
const More = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/More').default)
    }, 'More')
}


//资讯
const Info = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/Info').default)
    }, 'Info')
}
const InfoDetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/InfoDetail').default)
    }, 'InfoDetail')
}
const iframe = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/Common/iframe').default)
    }, 'iframe')
}

//积分商城
const Integral = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/Integral').default)
    }, 'Integral')
}
const IntegralMyself = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/IntegralMyself').default)
    }, 'IntegralMyself')
}
const TaskToday = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/TaskToday').default)
    }, 'TaskToday')
}
const Umtauschen = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/Umtauschen').default)
    }, 'Umtauschen')
}
const MyPackage = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/MyPackage').default)
    }, 'MyPackage')
}
const myOrder = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/myOrder').default)
    }, 'myOrder')
}
const orderDetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/orderDetail').default)
    }, 'orderDetail')
}
const packageDetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/packageDetail').default)
    }, 'packageDetail')
}
const ProductDetails = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/ProductDetails').default)
    }, 'ProductDetails')
}
const ProductMore = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/ProductMore').default)
    }, 'ProductMore')
}
const companyInfo = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/companyInfo').default)
    }, 'companyInfo')
}
const companyIntro = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/companyIntro').default)
    }, 'companyIntro')
}
const integralInfo = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/integralInfo').default)
    }, 'integralInfo')
}
const position = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./Comment/position').default)
    }, 'position')
}

render((
    <Router history={hashHistory}>
        <Route path='/' getComponent={Roots}>
            <IndexRoute getComponent={Index}/>
            <Route path='Index' getComponent={Index}/>
            <Route path='Notice' getComponent={Notice}/>
            <Route path='NtcDetail(/:id)' getComponent={NtcDetail}/>
            <Route path='NtcDetailFile(/:id)(/:name)(/:url)' getComponent={NtcDetailFile}/>
            <Route path='Task' getComponent={Task}/>
            <Route path='TaskDetail(/:id)' getComponent={TaskDetail}/>
            <Route path='TaskPublish(/:app)' getComponent={TaskPublish}/>
            <Route path='Score' getComponent={Score}/>
            <Route path='ScoreDetail/:id(/:tongkao)(/:classid)' getComponent={ScoreDetail}/>
            <Route path='ClassAlbum(/:id)(/:photoid)' getComponent={ClassAlbum}/>
            <Route path='AddPhoto(/:id)(/:photoid)(/:content)' getComponent={AddPhoto}/>
            <Route path='AddAlbum(/:id)(/:edit)(/:bookid)(/:name)(/:content)' getComponent={AddAlbum}/>
            <Route path='AlbumDetail(/:id)(/:classid)(/:name)(/:content)(/:edit)(/:photoid)' getComponent={AlbumDetail}/>
            <Route path='ApplyLeave(/:id)' getComponent={ApplyLeave}/>
            <Route path='LeaveDetail(/:id)(/:name)(/:type)(/:timefrom)(/:timeto)(/:status)(/:content)(/:content_t)' getComponent={LeaveDetail}/>
            <Route path='LeaveList' getComponent={LeaveList}/>
            <Route path='SubjectTimetable' getComponent={SubjectTimetable}/>
            <Route path='PhoneDirectories' getComponent={PhoneDirectories}/>
            <Route path='GrowthRecord' getComponent={GrowthRecord}/>
            <Route path='GrowthRecordDetails(/:id)(/:iscomment)' getComponent={GrowthRecordDetails}/>
            <Route path='AddGrowthRecord' getComponent={AddGrowthRecord}/>
            <Route path='News' getComponent={News}/>
            <Route path='More' getComponent={More}/>

            <Route path='Info' getComponent={Info}/>
            <Route path='InfoDetail/:id/:wherefrom(/:sign)(/:isShare)' getComponent={InfoDetail}/>
            <Route path='iframe/:sign/:title/:url' getComponent={iframe}/>

            <Route path='Integral' getComponent={Integral}/>
            <Route path='IntegralMyself' getComponent={IntegralMyself}/>
            <Route path='TaskToday' getComponent={TaskToday}/>
            <Route path='Umtauschen' getComponent={Umtauschen}/>
            <Route path='MyPackage' getComponent={MyPackage}/>
            <Route path='myOrder' getComponent={myOrder}/>
            <Route path='orderDetail/:id' getComponent={orderDetail}/>
            <Route path='packageDetail/:id' getComponent={packageDetail}/>
            <Route path='ProductDetails/:id' getComponent={ProductDetails}/>
            <Route path='ProductMore/:id' getComponent={ProductMore}/>
            <Route path='integralInfo' getComponent={integralInfo}/>
            <Route path='companyInfo/:id' getComponent={companyInfo}/>
            <Route path='companyDetail/:id' getComponent={companyIntro}/>
            <Route path='position/:title/:address/:lng/:lnt' getComponent={position}/>
        </Route>
    </Router>
), document.getElementById('app'));
